<?php
if (!defined('__COLA_DIR__')) exit;
/**
 * 提交按钮表单项帮手
 *
 * @author edikud
 * @package Form
 * @copyright Copyright (c) 2019 Cola (http://www.mcooo.com)
 * @license GNU General Public License 2.0
 */

class Form_Submit extends Form_Group
{
	
    /**
     * 初始化当前输入项
     *
     * @access public
     * @param string $name 表单元素名称
     * @param array $options 选择项
     * @return Element
     */
    public function input($name = NULL, array $options = NULL)
    {
        $input = new Element('button', array('type' => 'submit', 'class' => 'form-submit', 'data-loading-text' => 'loading..'));
        $this->set($input);
        return $input;
    }

    /**
     * 设置表单元素值
     *
     * @access protected
     * @param mixed $value 表单元素值
     * @return void
     */
    protected function _value($value)
    {
        $this->input
		    ->reset()
			->set($value);
    }
}
